<template>
    <div class="user-page">
    <div class="main">
        <van-cell-group>
            <van-cell title="姓名"  :value="userList.name"  />
        </van-cell-group>
        <van-cell-group>
            <van-cell title="性别"  :value="userList.sex | sexFilter"  />
        </van-cell-group>
        <van-cell-group>
            <van-cell title="学历"  :value="userList.education "  />
        </van-cell-group>
        <van-cell-group>
            <van-cell title="电话"  :value="userList.phone"  />
        </van-cell-group>
        <van-cell-group>
            <van-cell title="邮箱"  :value="userList.email"  />
        </van-cell-group>
        <div class="info">
            <van-panel title="个人介绍">
                <div class="text-detail">{{userList.selfIntroduction}}</div>
            </van-panel>     
        </div>
        <div class="info">
            <van-panel title="项目">
                <div class="text-detail">{{userList.project}}</div>
            </van-panel>    
        </div>    
    </div>
    </div>
</template>

<script>
import * as api from'./../../api/api.js'
export default {
    name:'userPage',
    data(){
        return{
            userList:{}
        }
    },
    methods:{
        fetchUser(){
            let vm = this;
            let body={
                openId:sessionStorage.getItem('wxInfo'),
                // openId:'o_2t6wd_R1vLGmFncSKoiKH4ADsI'
            }
            api.getUserInfo(body).then(res=>{
                console.log(res);
                vm.userList=res.data.data;
            })
        }
    },
    mounted(){
        this.fetchUser();
        document.title='个人信息'
    },
}
</script>


<style scoped lang="scss">
.user-page{
    .main{
        padding-top:.266667rem;
        .info{
            margin-top:.266667rem;
            .text-detail{
                padding:.4rem;
                color:#666;
            }
        }
    }

}
</style>
